#ifndef SNAKEGAME_H
#define SNAKEGAME_H

#include <QDialog>
#include <QLabel>
#include <QKeyEvent>
#include <QApplication>
#include <QTimer>
#include <QTime>
#include <QMessageBox>

enum Direction {D_UP , D_DOWN , D_LEFT , D_RIGHT};

class SnakeGame : public QDialog
{
    Q_OBJECT
private:
    /* snake */
    QList<QLabel *> snake;
    /* direction */
    Direction dire;
    /* food of snake , the type is same to the snake's */
    QLabel *food;
    /* step size */
    int footLen ;
    /* the max length of snake */
    int Maxlen;
    /* timer */
    QTimer *timer;

public :
    int sec;
    SnakeGame();
    ~SnakeGame();
    /* create the food in the dialog */
    QLabel* getFood();
    /* key event */
    void keyPressEvent(QKeyEvent *e);
public slots:
    /* snake movement */
    void snakeMove();
};


#endif // SNAKEGAME_H
